Ext.ns("SafeDutyView");
SafeDutyView = Ext.extend(Ext.Panel, {
    constructor : function(a) {
        Ext.applyIf(this, a);
        var all=this.initUIComponents();
        SafeDutyView.superclass.constructor.call(this, {
            id : "SafeDutyView",
            title : "安全值班管理",
            region : "center",
            layout : "border",
            border : false,
            iconCls : "menu-position",
            items : [all.yearGridPanel,all.yearGridSearchPanel,all.yearGridTreePanel]
        });
    },
    initUIComponents : function() {
         var yearGridComponents=new createyeargridview({
            topbar : {
                inputFormName : 'SafeDutyForm',
                topbarAdd:{
                    hidden:false
                },
                topbarDel:{
                    hidden:false
                }
            },
            search : {
                items : [ {
                    style : "margin:5px 5px 5px 5px;",
                    text : "值班人员"
                }, {
                    columnWidth : 0.2,
                    xtype : "textfield",
                    name : "Q_dutyPerson_S_LK",
                    maxLength : 256
                } ]
            },
            grid : {
                title : "安全值班列表",
                rowActions:true,
                listUrl : __ctxPath + "/safeduty/listSafeDuty.do",
                removeUrl : __ctxPath + "/safeduty/deleteSafeDuty.do",
                fields : [ "id", 'years','institution','serialNumber', "dutyPerson", "dutyDate", "situations","dutyPart"],
                columns : [ {
                    header : "id",
                    dataIndex : "id",
                    hidden : true
                }, {
                    header : "年份",
                    dataIndex : "years",
                    width : 50,
                    hidden:true,
                    sortable : true
                }, {
                    header:"所属机构",
                    dataIndex:'institution',
                    width:100
                },{
                    header : "序号",
                    dataIndex : "serialNumber",
                    width : 100
                }, {
                    header : "值班人员",
                    dataIndex : "dutyPerson",
                    width : 70
                }, {
                    header : "值班日期",
                    dataIndex : "dutyDate",
                    width : 70
                }, {
                    header : "值班部位",
                    dataIndex : "dutyPart",
                    width : 100
                },{
                    header : "值班情况",
                    dataIndex : "situations",
                    width:100
                } ]
            },
            tree : {
                treeUrl : __ctxPath + "/safeduty/treeLoadSafeDuty.do"
            }
            
        });
        return yearGridComponents;
    }
});